using UnityEditor;
using UnityEngine;
using Sirenix.Utilities.Editor;
using Sirenix.OdinInspector;
using Sirenix.OdinInspector.Editor;
using System.Collections.Generic;

public class ConfigEditor : OdinMenuEditorWindow
{
    protected override OdinMenuTree BuildMenuTree()
    {
        OdinMenuTree tree = new OdinMenuTree(true)
        {
            {"DebugView", this, EditorIcons.SettingsCog}, // draws the someDataField in this case.
        };

        tree.DefaultMenuStyle = OdinMenuStyle.TreeViewStyle;
        tree.Config.DrawSearchToolbar = true;

        tree.AddAllAssetsAtPath("GameConfig", "ConfigCreator/Resources/Configs", typeof(ScriptableObject), true)
            .AddThumbnailIcons();

        return tree;
    }


    [MenuItem("Tools/>>>ConfigView<<<")]
    private static void OpenView()
    {
        var window = GetWindow<ConfigEditor>();
        window.autoRepaintOnSceneChange = true;
        window.Show();
    }
}
